import {Button, Form, Input} from "antd";

const UserQuery = (props) => {

    const {pageQueryUserReq, setPageQueryUserReq, doPageQuerySysUsers} = props;

    return (
        <div>
            <Form>
                <Form.Item>
                    <label>用户账号：</label>
                    <Input style={{width: '300px'}} placeholder={"请输入用户账号"}
                           value={pageQueryUserReq.userAccount}
                           onChange={(e) => {
                               setPageQueryUserReq({
                                   ...pageQueryUserReq,
                                   userAccount: e.target.value
                               })
                           }}
                    />

                    <label style={{marginLeft: '30px'}}>用户昵称：</label>
                    <Input style={{width: '300px'}} placeholder={"请输入用户昵称"}
                           value={pageQueryUserReq.userNickname}
                           onChange={(e) => {
                               setPageQueryUserReq({
                                   ...pageQueryUserReq,
                                   userNickname: e.target.value
                               })
                           }}
                    />
                </Form.Item>

                <Form.Item>
                    <Button type={'primary'}
                            onClick={() => doPageQuerySysUsers()}>
                        查询
                    </Button>
                    <Button danger={true} style={{marginLeft: '15px'}}
                            onClick={() => {
                                setPageQueryUserReq({
                                    pageNum: 1,
                                    pageSize: 10,
                                    userAccount: '',
                                    userNickname: ''
                                });
                                doPageQuerySysUsers({
                                    pageNum: 1,
                                    pageSize: 10,
                                    userAccount: '',
                                    userNickname: ''
                                })
                            }}>
                        清空条件
                    </Button>
                </Form.Item>
            </Form>
        </div>
    )
}
export default UserQuery;